package com.sc.byahi.user.shared;

import java.util.ArrayList;
import java.util.List;

//import javax.persistence.Id;

public class ProfileMetadata extends AbstractEntity<Long> {
	private static final long serialVersionUID = 1L;
	
	public static String INIT_PROFILE_ID = "initProfileId";
	public static String TARGET_PROFILE_ID = "targetProfileId";
	public static String ACTION = "action";
	public static String VALUE = "value";
		
	public static final String INTEREST_VALUE_SENT = "INTEREST_SENT";
	public static final String INTEREST_VALUE_ACCEPTED = "INTEREST_ACCEPTED";
	public static final String INTEREST_VALUE_ON_HOLD= "INTEREST_ON_HOLD";
	
	public static final String ACTION_INTEREST = "INTEREST";
	public static final String ACTION_RATE = "RATE";
	public static final String ACTION_MAIL = "MAIL";
	
	public static final String IS = "IS";
	public static final String IA = "IA";
	public static final String IH= "IH";
	public static final String RR = "RR";
	public static final String RA = "RA";
	public static final String RH= "RH";

//	@Id
	protected Long id = null;
	private Long initProfileId;
	private Long targetProfileId;
	private String action;
	private String value;

	@Override
	public List<String> getUnindexedPropertyNames() {
		List<String> props = new ArrayList<String>();
		return props;
	}

	@Override
	public List<String> getIndexedPropertyNames() {
		List<String> props = new ArrayList<String>();
		props.add(INIT_PROFILE_ID);
		props.add(TARGET_PROFILE_ID);
		props.add(ACTION);
		props.add(VALUE);

		return props;
	}
	@Override
	public Object getProperty(String key) {
		if (INIT_PROFILE_ID.equals(key)) {
			return getInitProfileId();
		}
		if (TARGET_PROFILE_ID.equals(key)) {
			return getTargetProfileId();
		}
		if (ACTION.equals(key)) {
			return getAction();
		}
		if (VALUE.equals(key)) {
			return getText();
		}

		return null;
	}

	public void setProperty(String key, Object value) {
		if (INIT_PROFILE_ID.equals(key)) {
			setInitProfileId((Long) value);
		}
		if (TARGET_PROFILE_ID.equals(key)) {
			setTargetProfileId((Long) value);
		}
		if (ACTION.equals(key)) {
			setAction((String) value);
		}
		if (VALUE.equals(key)) {
			setText((String) value);
		}
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		if (id != null){
			this.id = id;
		}
	}

	public Long getInitProfileId() {
		return initProfileId;
	}

	public void setInitProfileId(Long initProfileId) {
		this.initProfileId = initProfileId;
	}

	public Long getTargetProfileId() {
		return targetProfileId;
	}

	public void setTargetProfileId(Long targetProfileId) {
		this.targetProfileId = targetProfileId;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public String getText() {
		return value;
	}

	public void setText(String text) {
		this.value = text;
	}
}
